**********REPLICATION SCRIPTS

***DEPENDENT VARIABLES
*CONVERSION THERAPY
gen conv = TM1676Y19

*RELIGIOUS REFUSALS
recode TM1677Y19_1 (1=1) (2=2) (5=3) (3=4) (4=5), gen(bus5)
recode TM1677Y19_2 (1=1) (2=2) (5=3) (3=4) (4=5), gen(med5)
recode TM1677Y19_3 (1=1) (2=2) (5=3) (3=4) (4=5), gen(emp5)
recode TM1677Y19_4 (1=1) (2=2) (5=3) (3=4) (4=5), gen(ad5)

*HIGH internal consistency: 0.91
alpha bus5-ad5, gen(refusals) 

***EXPLANATORY VARIABLES

gen log_age = log(resp_age)

*sex

recode EDUATT (1/2 =1 "HS or less") (3/4=2 "CollGrad"), gen(coll)

*race2

gen married = Z6==3

*EMPLY b1

gen kids = z8a==1

recode party_id (1=1 "Strong Democrat") (2=2 "Democrat") (2.2 = 3 "Lean Democrat") (2.6=5 "Lean Republican") (3=6 "Republican") (4=7 "Strong Republican") (5=4 "Independent") (6/7=4), gen(pid7)

gen rural = TM1440Y18==3

gen lgbt = 0
foreach var of varlist TM1664Y19_1-TM1664Y19_3{
recode lgbt (0=1) if `var'==5
}
recode lgbt (0=1) if TM1666Y19==4

*contact measures
recode TM1666Y19 (1=0) (6=0) (2/4=1), gen(gay_contact)

gen trans_contact = 0
foreach var of varlist TM1664Y19_1-TM1664Y19_3{
recode trans_contact (0=1) if `var'==3 | `var'==4 | `var'==5
}

gen raise_trans = TM1665Y19==1

***TABLE 1
prop bus5 med5 emp5 ad5 conv [pweight = WEIGHTS]


***TABLE 2

*MODEL 1
reg refusals i.sex i.race2 log_age i.married i.coll i.rural i.lgbt i.kids party_id i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS]

*MODEL 2 - code for significance tests and predictions for figure 1
reg refusals i.sex i.race2 log_age i.married i.coll i.rural i.lgbt  party_id i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS]
margins kids#gay_contact kids#trans_contact kids#raise_trans, atmeans post

lincom _b[1.kids#1.gay_contact] - _b[1.kids#0.gay_contact]
* diff = 0.73,, se = .15, p <.001

lincom _b[0.kids#1.gay_contact] - _b[0.kids#0.gay_contact]
* diff = 0.57, se = .10, p <.001

lincom _b[1.kids#1.gay_contact] - _b[0.kids#1.gay_contact]
*diff = 0.26, se = .0986, p = .009

lincom _b[1.kids#1.gay_contact] - _b[1.kids#0.gay_contact] - (_b[0.kids#1.gay_contact] - _b[0.kids#0.gay_contact])
*diffdiff = .15, se = .19, p = .403

lincom _b[0.kids#1.trans_contact] - _b[0.kids#0.trans_contact]
*same as coef

lincom _b[1.kids#1.trans_contact] - _b[1.kids#0.trans_contact]
*ns

lincom _b[0.kids#1.raise_trans] - _b[0.kids#0.raise_trans]
*ns

*0.2
*diff = -0.26, se = .16; p = .107

lincom _b[1.kids#1.raise_trans] - _b[1.kids#0.raise_trans] - (_b[0.kids#1.raise_trans] - _b[0.kids#0.raise_trans])

*MODEL 3
mlogit conv i.sex i.race2 log_age i.married i.coll i.rural i.lgbt i.kids   party_id i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS], base(2)

*MODEL 4 - code for significance tests & predictions for figure 2
mlogit conv i.sex i.race2 log_age i.married i.coll i.rural i.lgbt party_id i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS], base(2)

margins kids#gay_contact kids#trans_contact kids#raise_trans, atmeans post

lincom _b[1._predict#1.kids#0.raise_trans] - _b[1._predict#1.kids#1.raise_trans]
*diff = 0.13, se = .09, p = .13

lincom _b[1._predict#0.kids#1.raise_trans] - _b[1._predict#1.kids#1.raise_trans]
*diff = 0.24, se = 0.0956, p = 0.013

lincom _b[3._predict#1.kids#0.raise_trans] - _b[3._predict#1.kids#1.raise_trans]
*diff = -0.18, se = 0.100, p = .071


*****SUPPLEMENTARY INFORMATION
tab race2, gen(r_)
tab conv, gen(c_)

tabstat sex r_2 r_3 r_4 log_age married coll rural lgbt kids party_id gay_contact trans_contact raise_trans refusals c_1 c_3 [aweight = WEIGHTS], s(mean sd min max)
pwcorr sex r_2 r_3 r_4 log_age married coll rural lgbt kids party_id gay_contact trans_contact raise_trans refusals c_1 c_3 [aweight = WEIGHTS], sig

quietly: reg refusals i.sex i.race2 log_age i.married i.coll i.rural i.lgbt i.kids party_id i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS]
estat vif

quietly: reg refusals i.sex i.race2 log_age i.married i.coll i.rural i.lgbt  party_id i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS]
estat vif

*auxiliary models.
reg refusals i.sex i.race2 log_age i.married i.coll i.rural i.lgbt  party_id i.kids##(i.gay_contact) i.trans_contact i.raise_trans [pweight = WEIGHTS]
margins kids#gay_contact
reg refusals i.sex i.race2 log_age i.married i.coll i.rural i.lgbt  party_id i.gay_contact  i.kids##(i.trans_contact) i.raise_trans [pweight = WEIGHTS]
margins kids#trans_contact
reg refusals i.sex i.race2 log_age i.married i.coll i.rural i.lgbt  party_id i.gay_contact i.trans_contact  i.kids##(i.raise_trans) [pweight = WEIGHTS]
margins kids#raise_trans

mlogit conv  i.sex i.race2 log_age i.married i.coll i.rural i.lgbt  party_id i.kids##(i.gay_contact) i.trans_contact i.raise_trans [pweight = WEIGHTS], base(2)
margins kids#gay_contact
mlogit conv i.sex i.race2 log_age i.married i.coll i.rural i.lgbt  party_id i.gay_contact  i.kids##(i.trans_contact) i.raise_trans [pweight = WEIGHTS], base(2)
margins kids#trans_contact
mlogit conv  i.sex i.race2 log_age i.married i.coll i.rural i.lgbt  party_id i.gay_contact i.trans_contact  i.kids##(i.raise_trans) [pweight = WEIGHTS], base(2)
margins kids#raise_trans

reg refusals i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS] if lgbt==0
reg refusals i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS] if lgbt==0

mlogit conv i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS] if lgbt==0, base(2)
mlogit conv i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS] if lgbt==0, base(2)

foreach var of varlist bus5-ad5 {
recode `var' (1/4=0) (5=1), gen(`var'_d)
}

alpha bus5_d-ad5_d, gen(ref_2)
sum ref_2

reg ref_2 i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids i.lgbt i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS] 
reg ref_2 i.sex i.race2 log_age i.married i.coll i.rural party_id i.lgbt i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS] 

*other lgbt variables
recode TM1674Y19 (1=3) (3=2) (2=1), gen(ndo)
recode TM369Y14 (1=3) (3=2) (2=1), gen(mar)
recode TM1675Y19 (1=3) (3=2) (2=1), gen(adopt)

recode conv (1=3) (2=1) (3=2), gen(conv2)

prop ndo mar adopt [pweight = WEIGHTS]

pwcorr refusals conv2 ndo mar adopt [aweight = WEIGHTS], sig

mlogit ndo i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids i.lgbt i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS], base(1)
*mlogit ndo i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS] if lgbt==0, base(1)

mlogit mar i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids i.lgbt i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS], base(1)
*mlogit mar i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS] if lgbt==0, base(1)

mlogit adopt i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids i.lgbt i.gay_contact i.trans_contact i.raise_trans [pweight = WEIGHTS], base(1)
*mlogit adopt i.sex i.race2 log_age i.married i.coll i.rural party_id i.kids##(i.gay_contact i.trans_contact i.raise_trans) [pweight = WEIGHTS] if lgbt==0, base(1)
